/* ApicAday - Everyday.. is different, your mood, your life. Copyright (c) 2010 Oliver Selinger <oliver.selinger@autburst.com>, Michael Greifeneder <michael.greifeneder@autburst.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.autburst.picture; import android.app.Activity; import android.content.SharedPreferences; import android.graphics.PixelFormat; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.widget.MediaController; import android.widget.VideoView; public class VideoDemoActivity extends Activity { private static final String TAG = VideoDemoActivity.class.getSimpleName(); private String albumName; private String videoId; private VideoView video; private MediaController ctlr; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().setFormat(PixelFormat.TRANSLUCENT); setContentView(R.layout.video); albumName = getIntent().getStringExtra("albumName"); SharedPreferences preferences = getSharedPreferences( Utilities.PIC_STORE, 0); videoId = preferences.getString(albumName + ".videoId", "http://commonsware.com/misc/test2.3gp"); Log.d(TAG, "albumName: " + albumName + " videoId: " + videoId); // File clip=new File(Environment.getExternalStorageDirectory(), // "test.mp4"); String videoUrl = "http://server.autburst.com/movies/" + videoId + "/" + albumName + ".mp4"; Log.d(TAG, "videoUrl for Preview: " + videoUrl); Uri uri = Uri.parse(videoUrl); // if (clip.exists()) { video = (VideoView) findViewById(R.id.videoView); // video.setVideoPath(clip.getAbsolutePath()); video.setVideoURI(uri); ctlr = new MediaController(this); ctlr.setMediaPlayer(video); video.setMediaController(ctlr); video.requestFocus(); video.start(); // } } }